package com.qk.mangement.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户数据访问接口
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据角色id查询用户
     * @param id 角色id
     * @return List<User>
     */
    @Select("select * from user where role_id = #{id}")
    List<User> selectByRoleId(Integer id);


    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    List<UserDO> selectByPage(UserDTO dto);





    @Select("select * from user where id = #{id}")
    User selectById(Integer id);


    void deleteBatch(List<Integer> ids);

}